import java.util.Random;
import java.util.Scanner;

public class TestDemo {
    public static void main(String[] args) {
        Random rand = new Random();
        int num=rand.nextInt(100);
        int a = 0;
        do{
            System.out.println("请输入一个0到100的整数：");
            Scanner scanner = new Scanner(System.in);
            a = scanner.nextInt();
            if(a > num){
                System.out.println("输大了");
            } if(a < num){
                System.out.println("输小了");
            }
        }while(a != num);
        System.out.println("输入正确");
    }
}
